Skip to content

Conversation

@jinboson
Copy link

@jinboson jinboson commented Dec 5, 2024

No description provided.

@jinboson
Copy link
Author

jinboson commented Dec 5, 2024

when building with cmake .. -DWITH_PIPEWIRE=false, following errors are met:

/home/Jin/data/community/ssr/src/GUI/PageInput.h: In member function ‘QString PageInput::GetVideoPipeWireSource()’:
/home/Jin/data/community/ssr/src/GUI/PageInput.h:305:51: error: ‘m_lineedit_video_pipewire_source’ was not declared in this scope
inline QString GetVideoPipeWireSource() { return m_lineedit_video_pipewire_source->text(); }
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/Jin/data/community/ssr/src/GUI/PageInput.h:305:51: note: suggested alternative: ‘m_lineedit_video_v4l2_device’
inline QString GetVideoPipeWireSource() { return m_lineedit_video_pipewire_source->text(); }
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
m_lineedit_video_v4l2_device
/home/Jin/data/community/ssr/src/GUI/PageInput.h: In member function ‘unsigned int PageInput::GetVideoPipeWireWidth()’:
/home/Jin/data/community/ssr/src/GUI/PageInput.h:306:55: error: ‘m_spinbox_video_pipewire_width’ was not declared in this scope
inline unsigned int GetVideoPipeWireWidth() { return m_spinbox_video_pipewire_width->value(); }
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/Jin/data/community/ssr/src/GUI/PageInput.h:306:55: note: suggested alternative: ‘m_spinbox_video_x11_width’
inline unsigned int GetVideoPipeWireWidth() { return m_spinbox_video_pipewire_width->value(); }
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
m_spinbox_video_x11_width
/home/Jin/data/community/ssr/src/GUI/PageInput.h: In member function ‘unsigned int PageInput::GetVideoPipeWireHeight()’:
/home/Jin/data/community/ssr/src/GUI/PageInput.h:307:56: error: ‘m_spinbox_video_pipewire_height’ was not declared in this scope
inline unsigned int GetVideoPipeWireHeight() { return m_spinbox_video_pipewire_height->value(); }
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/Jin/data/community/ssr/src/GUI/PageInput.h:307:56: note: suggested alternative: ‘m_spinbox_video_x11_height’
inline unsigned int GetVideoPipeWireHeight() { return m_spinbox_video_pipewire_height->value(); }
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
m_spinbox_video_x11_height

We added simd accelerate for scale, converter and filter by
using simde to translate sse intrinsics to lsx intrinsics(
which is loongarch platform 128-bit simd instruction sets).

simde introduction:
https://github.com/simd-everywhere/simde
@jinboson
Copy link
Author

Below is benchmark result testd on LoongArch 3A5000 (4 cores 4 threads 2.5GHz):

./src/simplescreenrecorder --benchmark
==================== SSR started ====================
SimpleScreenRecorder 0.4.4
Compiled with GCC 8.3.0
Qt: header 5.15.2, lib 5.15.2
libavformat: header 58.76.100, lib 58.76.100
libavcodec: header 58.134.100, lib 58.134.100
libavutil: header 56.70.100, lib 56.70.100
libswscale: header 5.9.100, lib 5.9.100
[CPUFeatures::Detect] CPU features: lsx lasx
[Benchmark] Starting scaler benchmark ...
[BenchmarkScale] BGRA 1920x1080 to BGRA 1920x1080 | SWScale 2152 us | Fallback 2117 us ( 98%) | SSSE3 0 us ( 0%) | LSX 2113 us ( 99%)
[BenchmarkScale] BGRA 1280x720 to BGRA 1920x1080 | SWScale 43315 us | Fallback 20073 us ( 46%) | SSSE3 0 us ( 0%) | LSX 9253 us ( 46%)
[BenchmarkScale] BGRA 1920x1080 to BGRA 1280x720 | SWScale 32846 us | Fallback 10031 us ( 30%) | SSSE3 0 us ( 0%) | LSX 4693 us ( 46%)
[BenchmarkScale] BGRA 1920x1080 to BGRA 960x540 | SWScale 27689 us | Fallback 2552 us ( 9%) | SSSE3 0 us ( 0%) | LSX 2357 us ( 92%)
[BenchmarkScale] BGRA 1920x1080 to BGRA 640x360 | SWScale 20523 us | Fallback 4684 us ( 22%) | SSSE3 0 us ( 0%) | LSX 3393 us ( 72%)
[Benchmark] Starting converter benchmark ...
[BenchmarkConvert] BGRA 1920x1080 to YUV444 1920x1080 | SWScale 38139 us | Fallback 3188 us ( 8%) | SSSE3 0 us ( 0%) | LSX 2405 us ( 75%)
[BenchmarkConvert] BGRA 1920x1080 to YUV422 1920x1080 | SWScale 27497 us | Fallback 3652 us ( 13%) | SSSE3 0 us ( 0%) | LSX 2086 us ( 57%)
[BenchmarkConvert] BGRA 1920x1080 to YUV420 1920x1080 | SWScale 27762 us | Fallback 6253 us ( 22%) | SSSE3 0 us ( 0%) | LSX 2310 us ( 36%)
[BenchmarkConvert] BGRA 1920x1080 to NV12 1920x1080 | SWScale 32535 us | Fallback 4598 us ( 14%) | SSSE3 0 us ( 0%) | LSX 2282 us ( 49%)
[BenchmarkConvert] BGRA 1920x1080 to BGR 1920x1080 | SWScale 4056 us | Fallback 1369 us ( 33%) | SSSE3 0 us ( 0%) | LSX 990 us ( 72%)
==================== SSR stopped ====================
QFileSystemWatcher::removePaths: list is empty
QFileSystemWatcher::removePaths: list is empty

@jinboson
Copy link
Author

@MaartenBaert ping.

MaartenBaert added a commit that referenced this pull request Jan 25, 2025
@MaartenBaert
Copy link
Owner

I have merged your bugfix, but regarding the LSX changes, I don't like that this commit is duplicating basically all the SSE code - this seems unnecessary when the SIMDE library already provides a compatible API. It should be possible to support LSX with minimal changes to the original SSE code. However I don't have a CPU to test this on, so I can't try it myself.

@jinboson
Copy link
Author

Thank you, @MaartenBaert! I will try it for you. Happy New Year!

@jinboson jinboson closed this Feb 5, 2025
@jinboson jinboson reopened this Feb 5, 2025
@jinboson
Copy link
Author

jinboson commented Feb 5, 2025

Close the PR, LSX changes will be in new PR, thanks.

@jinboson jinboson closed this Feb 5, 2025
@jinboson
Copy link
Author

jinboson commented Feb 6, 2025

Hi @MaartenBaert . The LSX changes are ready for review, see Pr #1054. Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants